<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<script type="text/javascript" src="/oa/Public/js/jquery.js"></script>
<script type="text/javascript" src="/oa/Public/js/common.js"></script>
<link rel="stylesheet" type="text/css" href="/oa/Public/css/global.css" />
<link rel="stylesheet" type="text/css" href="/oa/Public/css/form.css" />
</head>
<body>
<div class="search">
	<form action="" method="post">
		<b>姓名查询：</b>
		<input type="text" name="name" value="<?php echo ($name); ?>" >
		<input type="submit" value="查询" value="<?php echo ($name); ?>" class="submit">
		<input type="button" value="添加" onclick="add();" class="button" />
		<input type="button" value="批量导入" onclick="import();" class="button" />
	</form>
</div>
<div class="list">
<table class="stripe" cellspacing="0">
    <thead>
        <tr>
            <th style="min-width: 30px;"><input type="checkbox" name="checkid" onclick="if(this.checked==true) { checkAll('key[]'); } else { clearAll('key[]'); }" ></th>
            <th width="8%">姓名</th>
            <th width="10%">工作地点</th>
            <th width="10%">部门</th>
            <th width="12%">职务</th>
            <th width="8%">工作牌号</th>
            <th width="16%">邮箱</th>
            <th width="6%">性别</th>
            <th width="10%">生日</th>
            <th width="6%">状态</th>
            <th width="12%">操作</th>
        </tr>
    </thead>
 
    <tbody>
   	  <?php if(is_array($data)): $i = 0; $__LIST__ = $data;if( count($__LIST__)==0 ) : echo "$empty" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr>
            <td><input type="checkbox" name="key[]" value="<?php echo ($vo["id"]); ?>"></td>
            <td><?php echo ((isset($vo["name"]) && ($vo["name"] !== ""))?($vo["name"]):"---"); ?></td>
            <td><?php echo ((isset($vo["work_add"]) && ($vo["work_add"] !== ""))?($vo["work_add"]):"---"); ?></td>
            <td><?php echo ((isset($vo["dept_name"]) && ($vo["dept_name"] !== ""))?($vo["dept_name"]):"---"); ?></td>
            <td><?php echo ((isset($vo["job_title"]) && ($vo["job_title"] !== ""))?($vo["job_title"]):"---"); ?></td>
            <td><?php echo ((isset($vo["work_card"]) && ($vo["work_card"] !== ""))?($vo["work_card"]):"---"); ?></td>
            <td><?php echo ((isset($vo["work_email"]) && ($vo["work_email"] !== ""))?($vo["work_email"]):"---"); ?></td>
            <td><?php echo ((isset($vo["sex"]) && ($vo["sex"] !== ""))?($vo["sex"]):"---"); ?></td>
            <td><?php echo ((isset($vo["birthday"]) && ($vo["birthday"] !== ""))?($vo["birthday"]):"---"); ?></td>
            <td><?php if($vo['work_status'] == '1'): ?>在职<?php else: ?>离职<?php endif; ?></td>
            <td><a href="javascript:void(0)" onclick="edit(<?php echo ($vo["id"]); ?>)" >编辑</a>  |  <a href="javascript:void(0)" onclick="del(<?php echo ($vo["id"]); ?>)">删除</a>  |  <a href="javascript:void(0)" onclick="view(<?php echo ($vo["id"]); ?>)">详情</a></td>
        </tr><?php endforeach; endif; else: echo "$empty" ;endif; ?>
    </tbody>
</table>
</div>
<div class="page"><?php echo ($page); ?></div>
</body>
</html>
<script language="javascript">
$(document).ready(function(){  
	$(".stripe tr").mouseover(function(){    
	  $(this).addClass("over");}).mouseout(function(){   
			$(this).removeClass("over");}) 
  	$(".stripe tr:even").addClass("alt");
});   
function del(id){
	if (confirm("真的要删除吗？数据删除之后不可恢复！")){
		$.get("/oa/index.php/Resources/delete?id="+id,function(result){
			location.reload();
		});
	}else{
		return false;
	}
}
function edit(id){
	window.location.href="/oa/index.php/Resources/edit?id="+id;
}
function add(){
	window.location.href="/oa/index.php/Resources/add";
}
function view(id){
	window.location.href="/oa/index.php/Resources/view?id="+id;
}
</script>